<template>
    <div class="box7">
        <div class="top">
            <p class="title">年度游客量对比</p>
            <p class="bg"></p>
        </div>
        <div class="charts" ref="charts"></div>
    </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'

let charts = ref()

onMounted(() => {
    let myvharts = echarts.init(charts.value)
    myvharts.setOption({
        title: {
            text: '散点图',
            left: '40%'
        },
        xAxis: {
            type: 'category',
            show: true,
        },
        yAxis: {
            show: false,
        },
        series: {
            type: 'scatter',
            data: [33, 88, 21, 9, 88, 234, 113, 1231, 674, 3, 88, 33, 21, 888, 3332, 313,
                123, 5, 657, 7,],
            //标记图形设置
            symbol: 'diamond',
            //图文标签
            label: {
                show: true,
                position: 'top',
                color: 'orange',
            },
        },
        grid: {
            left: 20,
            top: 20,
            right: 0,
            bottom: 20,
        },
    })
})
</script>

<style scoped lang="scss">
.box7 {
    width: 100%;
    height: 100%;
    background: url(../../images/dataScreen-main-lb.png) no-repeat;
    background-size: 100% 100%;
    margin-top: 10px;

    .top {
        margin-left: 20px;

        .title {
            color: white;
            font-size: 20px;
        }

        .bg {
            width: 68px;
            height: 7px;
            background: url(../../images//dataScreen-title.png) no-repeat;
            background-size: 100% 100%;
            margin: 10px 0;
        }
    }

    .charts {
        height: calc(100% - 30px);
    }
}
</style>